package com.cold.legendary.bprocess.db.enums;

import lombok.Getter;

/**
 * @author cold
 * @since 2022/3/25
 */
public enum PointRunStatusEnum {

    PROCESSING("processing", "进行中"),
    WAITING("waiting", "等待中"),
    FINISH("finish", "结束"),
    ERROR("error", "异常"),
    ;
    @Getter
    private String code;
    @Getter
    private String desc;

    PointRunStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PointRunStatusEnum of(String code) {
        for (PointRunStatusEnum em : PointRunStatusEnum.values()) {
            if (em.getCode().equals(code)) {
                return em;
            }
        }
        return null;
    }
}
